package com.lzm.ydpt.module.riding.activity;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.byt.framlib.base.BaseActivity;
import com.byt.framlib.basemvp.BasePresenter;
import com.byt.framlib.commonwidget.StatusBarUtil;
import com.byt.framlib.commonwidget.onclicktwo.AntiShake;
import com.lzm.ydpt.Dapplication;
import com.lzm.ydpt.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 个人信息页面
 */
public class MyInfoActivity extends BaseActivity {
    @BindView(R.id.img_my_info_avater)
    ImageView img_my_info_avater;
    @BindView(R.id.tv_my_info_name)
    TextView tv_my_info_name;
    @BindView(R.id.tv_my_info_realname)
    TextView tv_my_info_realname;
    @BindView(R.id.tv_my_info_phone)
    TextView tv_my_info_phone;

    @Override
    public int getLayoutId() {
        return R.layout.activity_my_info;
    }

    @Override
    public BasePresenter initPreData() {
        return null;
    }

    @Override
    public void initView() {
        if (Dapplication.getUserInfo() != null) {
//        ImageLoaderUtils.displayCircle(img_my_info_avater, Dapplication.getUserInfo().get);
            tv_my_info_name.setText(Dapplication.getUserInfo().getRealName());
            tv_my_info_realname.setText(Dapplication.getUserInfo().getRealName());
            tv_my_info_phone.setText(Dapplication.getUserInfo().getPhone());
        }
    }

    @OnClick({R.id.img_my_info_back, R.id.rl_contact_user})
    public void onClick(View view) {
        if (AntiShake.check(view.getId())) {
            return;
        }
        switch (view.getId()) {
            case R.id.img_my_info_back:
                finish();
                break;
            case R.id.rl_contact_user:
                openActivity(ContactUserActivity.class);
                break;
        }

    }

    @Override
    protected void setStatusBar() {
        StatusBarUtil.setColor(this, getResources().getColor(R.color.color_main));
        changStatusIconCollor(false);
    }
}
